var mySqrt = function(x) {
    var i = 1;
    while(x>=i*i){
        i++;
    }
    return i-1;
}; 
//方法2 ES6
var mySqrt = function(x) {
    return Math.floor(x ** 0.5);//向下取整 x^0.5
}; 

